package com.azt.data.utils;

import java.io.File;

import gui.ava.html.image.generator.HtmlImageGenerator;

public class Html2ImageUtil {

	public static String html2Image(String htmlstr,String ImagePath,String ImageName,String extension){
		String filepath=ImagePath+ImageName+"."+extension;
		HtmlImageGenerator imageGenerator = new HtmlImageGenerator();
		imageGenerator.loadHtml(htmlstr);
		imageGenerator.getBufferedImage();
		imageGenerator.saveAsImage(filepath);//保存图片到图片临时文件夹
		//图片上传阿里云
		File file=new File(filepath);
		String uploadImg = OSSFileUtils.uploadImg(file, "priceImageTmp", ImageName, extension);
		return uploadImg;
	}
	
}
